﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DotNetExtensions.Core.SQLite
{
    public class SQLiteDbContext
    {
        public SQLiteDbContext() { }

        public SQLiteDbContext(string connectionString)
        {
            ConnectionString = connectionString;
        }

        public string ConnectionString { get; set; }

        public DbSet<TEntity> CreateDbSet<TEntity>() where TEntity : class
        {
            if (string.IsNullOrEmpty(ConnectionString)) throw new Exception("SQLite db connection string can't be null");  return new DbSet<TEntity>(ConnectionString);
        }
    }
}
